<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
		<title> - 公告管理历史</title>
	    <meta name="keywords" content="">
	    <meta name="description" content="">
	    <link rel="shortcut icon" href="favicon.ico"> 
	    <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	    <link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	    <link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	    <link href="__STATIC__/css/animate.css" rel="stylesheet">
	    <link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	    <link href="__STATIC__/css/new_file.css" rel="stylesheet">
	</head>
	<body class="gray-bg">
		<div class="wrapper wrapper-content  animated fadeInRight">
			<div class="row">
				<div class="col-sm-12">
					<div class="ibox ">
						<div class="ibox-title">
							<h5>历史公告</h5>
						</div>
						<div class="toogl_body">
	                    	<a href="Notice.html"><button type="button" class="btn btn-w-m btn-bt btn-white">公告管理</button></a>
	                    	<a href="Notice_1.html"><button type="button" class="btn btn-w-m btn-info btn-bt">历史记录</button></a>
							<div class="ibox-content ibox-jqGrid">
								<div class="form-group mmp-gbl"><br/>
	                                <label class="col-sm-2 control-dy">查询时间：</label>
	                                <div class="col-sm-8 form-time1 input-sjjl">
	                                    <input type="text" placeholder="按创建时间查询" class="form-control form-time-bk" id="time1" readonly="readonly">
	                                    <span class="help-block m-b-none">请输入查询时间段</span>
	                                </div>
	                                <!-- <div class="form-group"><br/> -->
	                                <label class="col-sm-2 control-dy">状态：</label>
	                                <div class="col-sm-8 form-time1">
	                                    <select id="select_status">
											<option value="">请选择状态</option>
											<option value="2">待上架</option>
											<option value="1">已上架</option>
											<option value="0">已下架</option>
	                                    </select>
	                                </div>
	                                <button type="button" id="buttonid" class="btn btn-w-m btn-info">查询</button>
	                            </div>
		                        <div class="jqGrid_wrapper">
		                            <table id="table_list_1"></table>
		                            <div id="pager_list_1"></div>
		                        </div><br/>
		                        <div class="jqGrid_wrapper">
		                            <table id="table_list_2"></table>
		                            <div id="pager_list_2"></div>
		                        </div>
		                    </div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 游戏公告 修改  -->
		<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>修改信息</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="panel-body">
							<div class="ibox float-e-margins float-e-border">
								<div class="ibox-content">
									<form class="form-horizontal"><br/>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">标题：</label>
											 <input type="hidden"  class="form-control"  id="id_save" >
			                                <div class="col-sm-8">
			                                    <input type="text" placeholder="请输入标题" class="form-control" id= "title_save"> 
			                                    <span class="help-block m-b-none">请输入标题</span>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">排序：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" placeholder="请输入排序" class="form-control" id= "sort_save"> 
			                                    <span class="help-block m-b-none">请输入排序</span>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">上线时间：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" placeholder="请输入上线时间" class="form-control"  id= "time_save"> 
			                                    <span class="help-block m-b-none">请输入上线时间</span>
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">公告内容：</label>
			                                <div class="col-sm-8">
			                                    <textarea placeholder="请输入公告内容" class="form-control form-textarea" id= "conent_save"></textarea>
			                                    <span class="help-block m-b-none">请输入公告内容</span>
			                                </div>
			                            </div>
			                        </form>
								</div>
							</div>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="notice_save()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--游戏公告 修改end-->
		
		<!--新建公告下架  -->
		<div id="myModal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>消息提示</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="ibox-s ibox-s-zj">
							<p>是否下架该消息？<input type="hidden" id="out" /></p>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="_goOutClick()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 游戏公告 修改  -->
		<div id="myModals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>修改信息</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="panel-body">
							<div class="ibox float-e-margins float-e-border">
								<div class="ibox-content">
									<form class="form-horizontal"><br/>
			                           <input type="hidden"  class="form-control"  id="horse_id_save" >
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">生效时间：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" placeholder="请输入上线时间" class="form-control"  id="horse_time_save" >
			                                    <span class="help-block m-b-none">请输入生效时间</span>
			                                </div>
			                            </div>
										<div class="form-group">
											<label class="col-sm-2 control-label">播放时间间隔：</label>
											<div class="col-sm-8">
													<input type="text" placeholder="播放时间间隔：" class="form-control" id="horse_interval_time_save" >
													<!--<span class="help-block m-b-none">请输入播放时间间隔：</span>-->
												</div>
										</div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">活动内容：</label>
			                                <div class="col-sm-8">
			                                    <textarea placeholder="请输入公告内容" class="form-control form-textarea" id="horse_content_save" ></textarea>
			                                    <!--<span class="help-block m-b-none">请输入活动内容</span>-->
			                                </div>
			                            </div>
			                        </form>
								</div>
							</div>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="hoser_save()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--新建公告下架end-->
		<!--新建公告上线  -->
		<div id="myModal4" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>消息提示</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="ibox-s ibox-s-zj">
							<p>是否上线该消息？<input type="hidden" id="up" /></p>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="_goOutClick()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--新建公告上线end-->
		<!-- 跑马灯下架  -->
		<div id="myModal3" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>消息提示</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="ibox-s ibox-s-zj">
							<p>是否下架该消息？<input type="hidden" id="out2" /></p>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="_OutClick()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--跑马灯下架end-->
		<!--跑马灯上线  -->
		<div id="myModal6" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>消息提示</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="ibox-s ibox-s-zj">
							<p>是否上线该消息？<input type="hidden" id="up2" /></p>
						</div>
						<div class="ibox-butz">
							<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="_OutClick()">
							<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
						</div>
					</div>
				</div>
			</div>
		</div>
<!--手机导航-->
<div class="to-fdh" style="display: none;">
	<img class="to-imgd" src="__STATIC__/img/phonedh.jpg">
	<div class="mob-nrlb">
		<ul>
			<li>
				<a class="mob-nrdh">管理</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('Player/gameplayer')}">玩家管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('system/notice')}">公告管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('email/mail')}">邮件管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Club/club')}">亲友圈管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Money/money')}">提现管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Order/order')}">订单管理</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh">数据</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('data/datagk')}">概況</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datawf')}">玩法</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datalc')}">留存</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datass')}">实时数据</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataczfx')}">充值分析</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataclub')}">亲友圈统计</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/president')}">高级会长</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/regionaldata')}">地区数据</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh mob-qbh">权限</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_list')}">权限管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_group')}">用户组管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('account/account_details')}">后台账号管理</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
</div>
<div id="zkbg">
	<img src="__STATIC__/img/dp.gif">
</div>
<div class="vnl-zz" style="display:none">
	<div><img src="__STATIC__/img/bqhp.gif"></div>
</div>
<!--手机适配-->
		<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
		<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
		<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
		<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
		<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
		<script src="__STATIC__/js/content.js?v=1.0.0"></script>
		<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
		<script>
            //手机适配
            $(function(){
                if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                    $("head").append("<link>");
                    var css = $("head").children(":last");
                    css.attr({
                        rel:  "stylesheet",
                        type: "text/css",
                        href: "__STATIC__/css/phone_sp.css"
                    });
                    var mql = window.matchMedia("(orientation: portrait)");
                    if(mql.matches) { //竖屏样式
                        $(".vnl-zz").show();
                        $(".to-fdh").hide();
                    }else{
                        $(".to-fdh").show();
                        $("html").width("100%");
                        $("body").width("100%");
                    }
                    mql.addListener(function(m) {
                        if(m.matches) {
                            // 改变到直立方向
                            $(".vnl-zz").show();
                            $(".to-fdh").hide();
                        }
                        else {
                            $(".to-fdh").show();
                            $(".vnl-zz").hide();
                            $("html").width("100%");
                            $("body").width("100%");
                        }
                    });
                }
            });
            //导航显示展开
            $(".mob-nrdh").click(function(){
                $(this).next().toggle(".mob-nryc");
            });
            $(".to-imgd").click(function(){
                $(this).next().toggle(".mob-nrlb");
            });
            //手机适配end

		$('#buttonid').on('click', function() {     //页面上的button按钮的click事件，重新获取参数后发送参数，然后重新加载数据。

              var time = $("#time1").val();
              var select_status =   $("#select_status").val();
              var start_time = time.substring(0,19);
		      var end_time = time.substring(22); 
		        // if(time =="" ){
		        // 	alert("请选择时间");
		        // 	return false;
		        // }
		        //  if(select_status ==""){
		        // 	alert("请选择状态");
		        // 	return false;
		        // }
                $("#table_list_1").jqGrid('setGridParam',{
                	url:'__URL__/notice_list_search',
                    datatype:'json',
                    // postData:{'keyword':encodeURI(encodeURI(keyword)),'select_status':encodeURI(encodeURI(select_status))}, //发送数据
                    postData:{'start_time':start_time,'end_time':end_time,'status':select_status}, //发送数据
                    page:1
                }).trigger("reloadGrid"); //重新载入
                $("#table_list_2").jqGrid('setGridParam',{
                	url:'__URL__/horse_list_search',
                    datatype:'json',
                    postData:{'start_time':start_time,'end_time':end_time,'status':select_status}, //发送数据
                    page:1
                }).trigger("reloadGrid"); //重新载入
            });

              function _getMessage(t) {
				var id = $(t).parent().parent().children().eq(0).html();
				var title = $(t).parent().parent().children().eq(1).html();
				var sort = $(t).parent().parent().children().eq(2).html();
				var start_time = $(t).parent().parent().children().eq(3).html();
				var end_time = $(t).parent().parent().children().eq(4).html();
				var content = $(t).parent().parent().children().eq(5).html();
				var time = start_time +' - '+ end_time;
				$('#id_save').val(id);
				$('#title_save').val(title);
				$('#sort_save').val(sort);
				$('#time_save').val(time);
				$('#conent_save').val(content);

			}
			 function _getMessages(t) {
				var id = $(t).parent().parent().children().eq(0).html();
				var interval_time = $(t).parent().parent().children().eq(1).html();
				var start_time = $(t).parent().parent().children().eq(2).html();
				var end_time = $(t).parent().parent().children().eq(3).html();
				var content = $(t).parent().parent().children().eq(4).html();
				var time = start_time +' - '+ end_time;
				$('#horse_id_save').val(id);
				$('#horse_time_save').val(time);
				$('#horse_interval_time_save').val(interval_time);
				$('#horse_content_save').val(content);

			}
			//公告修改
			function notice_save(){
				var Data={
		          id:$("#id_save").val(),
		          title:$("#title_save").val(),
		          content:$("#conent_save").val(),
		          sort:$("#sort_save").val(),
		          time:$("#time_save").val()
		        };
		         if(Data.title ==""){
        			alert("标题不能为空");
        			return false;
        		}
        		if(Data.content ==""){
        			alert("内容不能为空");
        			return false;
        		}
        		if(Data.sort ==""){
        			alert("排序不能为空");
        			return false;
        		}
        		if(Data.time ==""){
        			alert("时间不能为空");
        			return false;
        		}
		        var start_time = Data.time.substring(0,19);
		        var end_time = Data.time.substring(22);
			    $.ajax({
					type: "post",
					url: "__URL__/notice_update",
					data: {
						'id':Data.id,
						'title':Data.title,
						'content':Data.content,
						'sort':Data.sort,
						'start_time':start_time,
						'end_time':end_time,
					},
					dataType: "json",
					success: function(e) {
						var json = eval("("+e+")");
						alert(json.msg);
						location.reload();
					},
					error: function(e) {
						var json = eval("("+e+")");
						alert(json.msg);
					}
				});
				 // location.reload();
			}
			//跑马灯修改
			function hoser_save(){
				var Data={

				  id:$("#horse_id_save").val(),
		          content:$("#horse_content_save").val(),
		          interval_time:$("#horse_interval_time_save").val(),
		          time:$("#horse_time_save").val()
		        };
		        if(Data.content ==""){
        			alert("内容不能为空");
        			return false;
        		}
        		if(Data.interval_time ==""){
        			alert("时间间隔不能为空");
        			return false;
        		}
        		if(Data.time ==""){
        			alert("时间不能为空");
        			return false;
        		}
		        var start_time = Data.time.substring(0,19);
		        var end_time = Data.time.substring(22);
						
			    $.ajax({
					type: "post",
					url: "__URL__/horse_update",
					data: {
						'id':Data.id,
						'content':Data.content,
						'speed':Data.interval_time,
						'start_time':start_time,
						'end_time':end_time,
					},
					dataType: "json",
					success: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						alert(json.msg);
						location.reload();
					},
					error: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						alert(json.msg);
					}
				});
			     // location.reload();
			}
			//公告修改 状态
			function notice_status_save(t,status){
				
		  		var id = $(t).parent().parent().children().eq(0).html();
			    $.ajax({
					type: "post",
					url: "__URL__/update_notice_status",
					data: {
						'id':id,
						'status':status,
					},
					dataType: "json",
					success: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						// alert(json.msg);
					},
					error: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						// alert(json.msg);
					}
				});
			    location.reload();
			}
			//跑马灯修改 状态
			function hoser_status_save(t,status){
				var id = $(t).parent().parent().children().eq(0).html();
			    $.ajax({
					type: "post",
					url: "__URL__/update_horse_status",
					data: {
						'id':id,
						'status':status,
					},
					dataType: "json",
					success: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						// alert(json.msg);
					},
					error: function(e) {
						// console.log(e);
						var json = eval("("+e+")");
						// alert(json.msg);
					}
				});
			    location.reload();
			}
        $(document).ready(function () {

            $.jgrid.defaults.styleUI = 'Bootstrap';

            $("#table_list_1").jqGrid({
                url:'__URL__/notice_list',
                postData : {},
                datatype: "json",
                mtype: 'POST',
                height: 450,
                autowidth: true,
                shrinkToFit: true,
                rowNum: 20,
                rowList: [20,50,100],
                colNames: ['ID', '标题', '排序','发布时间','截止时间', '内容', '状态', '修改', '下架'],
                colModel: [
                    {
                        name: 'id',
                        index: 'id',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'title',
                        index: 'title',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'sort',
                        index: 'sort',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'start_time',
                        index: 'start_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                     {  name: 'end_time',
                        index: 'end_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        hidden :true,
                        align:'center'
                    },
                    {
                        name: 'content',
                        index: 'content',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
						name: 'status',
						index: 'status',
						width: 60,
						formatter: function(status) {
							switch(Number(status)){
									case 0:
										return '<span style="color:#00BFFF">已下架</span>'
									case 1:
										return '<span style="color:#00EE00">已上架</span>'
									case 2:
										return '<span style="color:#FF3030">待上架</span>'
								}
							// return '<input type="button" value="封禁" id="fj" class="btn btn-danger"/><input type="button" value="解禁" id="jj" class="btn btn-info"/>';
						},
                        align:'center'
					},
                    {
						name: 'isfinish',
						index: 'isfinish',
						width: 60,
						formatter: function() {
							return '<input type="button" value="修改" id="" data-toggle="modal" data-target="#myModal" class="btn btn-info" onclick="_getMessage(this)"/>';
						},
                        align:'center'
					},
                    {
						name: 'status',
						index: 'status',
						width: 60,
						formatter: function(status) {
							switch(Number(status)){
									case 0:
										return '<input type="button" value="上架" id="jj" class="btn btn-info" style="background:#FFA500" onclick ="notice_status_save(this,1)"/ >';
									case 1:
										return '<input type="button" value="下架" id="fj" class="btn btn-danger" style="background:#FF3030" onclick ="notice_status_save(this,0)"/>';
									case 2:
										return '<input type="button" value="上架" id="fj" class="btn btn-danger" style="background:#FFA500" onclick ="notice_status_save(this,1)"/>';
								}
						},
                        align:'center'
					}
                ],
                pager: "#pager_list_1",
                viewrecords: true,
                loadonce: true,
                caption: "标题公告历史记录",
                hidegrid: false
            });
            // $("#fj").hide();
            // $(function(){
            // 	$("#fj").click(function(){
            // 		$("#fj").hide();
            // 		$("#jj").show();
            // 		alert("封禁成功");
            // 	});
            // 	$("#jj").click(function(){
            // 		$("#jj").hide();
            // 		$("#fj").show();
            // 		alert("解禁成功");
            // 	});
            // });
			
            $("#table_list_2").jqGrid({
                url:'__URL__/horse_list',
                postData : {},
                datatype: "json",
                mtype: 'POST',
                height: 450,
                autowidth: true,
                shrinkToFit: true,
                rowNum: 20,
                rowList: [20,50,100],
                colNames: ['ID', '播放间隔', '发布时间','截止时间', '内容', '状态', '修改', '下架'],
                colModel: [
                    {
                        name: 'id',
                        index: 'id',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'interval_time',
                        index: 'interval_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    // {
                    //     name: 'sort',
                    //     index: 'sort',
                    //     width: 60,
                    //     sorttype: "int",
                    //     sortable: false
                    // },
                    {
                        name: 'start_time',
                        index: 'start_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {  name: 'end_time',
                        index: 'end_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        hidden :true,
                        align:'center'
                    },
                    {
                        name: 'content',
                        index: 'content',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
						name: 'status',
						index: 'status',
						width: 60,
						formatter: function(status) {
							switch(Number(status)){
									case 0:
										return '<span style="color:#00BFFF">已下架</span>'
									case 1:
										return '<span style="color:#00EE00">已上架</span>'
									case 2:
										return '<span style="color:#FF3030">待上架</span>'
								}
						},
                        align:'center'
					},
                    {
						name: 'isfinish',
						index: 'isfinish',
						width: 60,
						formatter: function() {
							return '<input type="button" value="修改" id="" data-toggle="modal" data-target="#myModals" class="btn btn-info" onclick="_getMessages(this)"/>';
						},
                        align:'center'
					},
                    {
						name: 'status',
						index: 'status',
						width: 60,
						formatter: function(status) {
							switch(Number(status)){
									case 0:
										return '<input type="button" value="上架" id="jj" class="btn btn-info" style="background:#FFA500" onclick ="hoser_status_save(this,1)"/ >';
									case 1:
										return '<input type="button" value="下架" id="fj" class="btn btn-danger" style="background:#FF3030" onclick ="hoser_status_save(this,0)"/>';
									case 2:
										return '<input type="button" value="上架" id="fj" class="btn btn-danger" style="background:#FFA500" onclick ="hoser_status_save(this,1)"/>';
								}
						},
                        align:'center'
					}
                ],
                pager: "#pager_list_2",
                loadonce: true,
                viewrecords: true,
                caption: "跑马灯历史记录",
                add: true,
                edit: true,
                addtext: 'Add',
                edittext: 'Edit',
                hidegrid: false
            });
            //  $("#fj2").hide();
            // $(function(){
            // 	$("#fj").click(function(){
            // 		$("#fj").hide();
            // 		$("#jj").show();
            // 		alert("封禁成功");
            // 	});
            // 	$("#jj2").click(function(){
            // 		$("#jj").hide();
            // 		$("#fj").show();
            // 		alert("解禁成功");
            // 	});
            // });
			setTimeout(function(){
                var width = $('.jqGrid_wrapper').width();
                $('#table_list_1').setGridWidth(width);
			},500);
            
		    laydate.render({
		      elem: '#time1'
		      ,type: 'datetime'
		      ,range: true
		    });
		    laydate.render({
		      elem: '#time_save'
		      ,type: 'datetime'
		      ,range: true
		    });
		    laydate.render({
		      elem: '#horse_time_save'
		      ,type: 'datetime'
		      ,range: true
		    });
        });
    </script>


	</body>

</html>